import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Introduce from '../views/Introduce/IntroduceView.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'introduce',
    component: Introduce
  },
  {
    path: '/learn',
    name: 'learn',
    component: () => import('../views/learn/LearnView.vue')
  },
  {
    path: '/story',
    name: 'story',
    component: () => import('../views/story/StoryView.vue')
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/about/AboutView.vue')
  },
  {
    path: '/admin',
    name: 'admin',
    component: () => import(/* webpackChunkName: "about" */ '../views/admin/AdminView.vue')
  }
]
// history: createWebHistory(process.env.BASE_URL),
const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
